﻿using System.ComponentModel.DataAnnotations;

namespace Hx.ADSyncPlatform.WebApi.Model
{
    /// <summary>
    /// 修改密码请求
    /// </summary>
    public class ChangePasswordRequest
    {

        /// <summary>
        /// 原始密码
        /// </summary>
        [Required(ErrorMessage = "原始密码不允许为空")]
        public string OldPassword { get; set; }

        /// <summary>
        /// 新密码
        /// </summary>
        [Required(ErrorMessage = "新密码不允许为空")]
        [MinLength(length: 6, ErrorMessage = "密码至少6位")]
        public string NewPassword { get; set; }

        /// <summary>
        /// 确认密码
        /// </summary>
        [Required(ErrorMessage = "确认密码不允许为空")]
        [CompareAttribute("NewPassword", ErrorMessage = "2次输入密码不一致")]
        public string ConfirmPassword { get; set; }

    }
}
